package org.example.service;

import org.example.dao.BookMapper;
import org.example.model.Book;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service

public class BookServiceImpl implements BookService {
    @Autowired
    private BookMapper bookMapper; //依赖注入dao层


    public int addBook(Book book) {
        int i = bookMapper.addBook(book);

        return i;
    }

    public int deleteBook(int id) {
        int i = bookMapper.deleteBook(id);

        return i;
    }

    public List<Book> getBooksByTypeAndName(int btype, String name) {
        List<Book> bookList = bookMapper.getBooksByTypeAndName(btype, name);
        return bookList;
    }


}
